from django.urls import path
from .views import products, dashboard

urlpatterns = [
    # 前端页面接口
    path("index/", products.index, name="productsHome"),
    path("api/search/", products.index, name="search"),
    # 数据面板
    path("api/dashboard/", dashboard.DashboardData.as_view(), name="productsDashboard"),
    path("api/dashboard/<int:product_id>/", dashboard.get_product_dashboard),
    # 产品管理接口
    # 获取用户的产品
    path(
        "api/product-types/", products.ProductTypeAPIView.as_view(), name="productType"
    ),
    path(
        "api/user-products/", products.UserProductsView.as_view(), name="UserProducts"
    ),
    path(
        "api/user-products-selector/",
        products.get_user_products_selector,
        name="projects_list_selector",
    ),
    path(
        "logo/<str:year>/<str:month>/<str:day>/<str:name>/",
        products.ProductLogo.as_view(),
        name="productLogo",
    ),
]
